package com.xiaoa.sync;



import java.util.List;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration  
@EnableAsync  
public class TestSync implements TestSyncIn{
	
	
	ThreadLocal<List<String>>  local = new ThreadLocal<List<String>>();
	
	
	@Async
	public void testSync(String message , long time)throws Throwable{
		
		
		List<String> messageList = local.get();
		
		if (messageList == null){
			
	
		}
		
		
		
		System.out.println( "threadName = " + Thread.currentThread().getName() + "============ 开始处理 " + message +"  time = " + time);
		Thread.sleep(time);
		System.out.println( "threadName = " + Thread.currentThread().getName() + "============ 处理完成 " + message +"  time = " + time);
	}
	

}
